package datastruct

import "fmt"

type LinkNode struct {
	Data int64
	NextNode *LinkNode
}

func LinkList () {
	node := new(LinkNode)
	node.Data = 1

	node1 := new(LinkNode)
	node1.Data = 2
	node.NextNode = node1

	node2 := new(LinkNode)
	node2.Data = 3
	node1.NextNode = node2

	node3 := new(LinkNode)
	node3.Data = 4
	node2.NextNode = node3

	// 查看链表
	nowNode := node
	for nowNode != nil {
		fmt.Println("node=", nowNode.Data)
		nowNode = nowNode.NextNode
	}
}

